package com.common.groovy.model;

import org.apache.logging.log4j.util.Strings;

import java.util.List;

/**
 * @Description:
 * @Date: 2025/7/2 16:15
 */
public class DataModel {
    private String name;
    private Table table;
    private List<Field> field;
    private List<ActionModel> action;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Table getTable() {
        return table;
    }

    public void setTable(Table table) {
        this.table = table;
    }

    public List<Field> getField() {
        return field;
    }

    public void setField(List<Field> field) {
        this.field = field;
    }

    public List<ActionModel> getAction() {
        return action;
    }

    public void setAction(List<ActionModel> action) {
        this.action = action;
    }

    public static class Table {
        private String name = Strings.EMPTY;
        private String aliasName = Strings.EMPTY;
        private String charset = "utf8mb4";
        private String comment = Strings.EMPTY;
        private String rowFormat = "DYNAMIC";
        private String collate = "utf8mb4_0900_ai_ci";
        private String engine = "InnoDB";

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public String getAliasName() {
            return aliasName;
        }

        public void setAliasName(String aliasName) {
            this.aliasName = aliasName;
        }

        public String getCharset() {
            return charset;
        }

        public void setCharset(String charset) {
            this.charset = charset;
        }

        public String getComment() {
            return comment;
        }

        public void setComment(String comment) {
            this.comment = comment;
        }

        public String getRowFormat() {
            return rowFormat;
        }

        public void setRowFormat(String rowFormat) {
            this.rowFormat = rowFormat;
        }

        public String getCollate() {
            return collate;
        }

        public void setCollate(String collate) {
            this.collate = collate;
        }

        public String getEngine() {
            return engine;
        }

        public void setEngine(String engine) {
            this.engine = engine;
        }
    }

    public static class Field {
        private Long id;
        private String name;
        private Boolean primaryKey;
        private String aliasName;
        private String comment;
        private String charset;
        private String collate;
        private String defaultValue;
        private String type;
        private Integer sort;
        private Boolean required;
        private Integer maxLength;
        private Boolean updateByCurrentTime;
        private Integer decimalDigits;

        public Integer getDecimalDigits() {
            return decimalDigits;
        }

        public void setDecimalDigits(Integer decimalDigits) {
            this.decimalDigits = decimalDigits;
        }

        public Boolean getUpdateByCurrentTime() {
            return updateByCurrentTime;
        }

        public void setUpdateByCurrentTime(Boolean updateByCurrentTime) {
            this.updateByCurrentTime = updateByCurrentTime;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public Boolean getPrimaryKey() {
            return primaryKey;
        }

        public void setPrimaryKey(Boolean primaryKey) {
            this.primaryKey = primaryKey;
        }

        public String getAliasName() {
            return aliasName;
        }

        public void setAliasName(String aliasName) {
            this.aliasName = aliasName;
        }

        public String getComment() {
            return comment;
        }

        public void setComment(String comment) {
            this.comment = comment;
        }

        public String getCharset() {
            return charset;
        }

        public void setCharset(String charset) {
            this.charset = charset;
        }

        public String getCollate() {
            return collate;
        }

        public void setCollate(String collate) {
            this.collate = collate;
        }


        public String getType() {
            return type;
        }

        public void setType(String type) {
            this.type = type;
        }

        public Integer getSort() {
            return sort;
        }

        public void setSort(Integer sort) {
            this.sort = sort;
        }

        public Boolean getRequired() {
            return required;
        }

        public void setRequired(Boolean required) {
            this.required = required;
        }

        public Integer getMaxLength() {
            return maxLength;
        }

        public void setMaxLength(Integer maxLength) {
            this.maxLength = maxLength;
        }

        public Long getId() {
            return id;
        }

        public void setId(Long id) {
            this.id = id;
        }

        public String getDefaultValue() {
            return defaultValue;
        }

        public void setDefaultValue(String defaultValue) {
            this.defaultValue = defaultValue;
        }
    }
}
